﻿Public Class FormVolume
    Private Sub LinkLabel1_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        Me.Close()
    End Sub

    Private Sub FormVolume_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Me.Size = New Size(160, 42)
        tbarVol.Value = My.Settings.PlayerVolume
        chkMute.Checked = My.Settings.PlayerMute
        If FormMain.TopMost = True Then Me.TopMost = True
    End Sub

    Private Sub chkMute_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkMute.CheckedChanged
        My.Settings.PlayerMute = chkMute.Checked
        If chkMute.Checked = True Then
            GUIImage("volume", "mute")
            My.Settings.PlayerMute = True
            FormMain.Mute(True)
        Else
            GUIImage("volume", "unmute")
            My.Settings.PlayerMute = False
            FormMain.Mute(False)
        End If
    End Sub

    Private Sub tbarVol_Scroll(sender As System.Object, e As System.EventArgs) Handles tbarVol.Scroll
        My.Settings.PlayerVolume = tbarVol.Value
        FormMain.Vol(tbarVol.Value)
        If chkMute.Checked = True Then chkMute.Checked = False
    End Sub
End Class